package org.no_ip.martin_springwald.google.api.extension.docs;

import com.google.gwt.gdata.client.impl.MapString;

/**
 * DocumentsListQuery: <br/> Contains type and parameters of DocumentsList API query
 */
public class DocumentsListQuery {

	/** Type: <br/> Query prototypes for DocumentsList API */
	public enum Type {
		/** ARCHIVE: <br/> archive creation */
		ARCHIVE("https://docs.google.com/feeds/%USER%/private/archive/%DOCID%"), //$NON-NLS-1$
		/** CHANGES: <br/> latest changes by user */
		CHANGES("https://docs.google.com/feeds/%USER%/private/changes"), //$NON-NLS-1$
		/** DOCUMENT: <br/> document feed by ID */
		DOCUMENT("https://docs.google.com/feeds/%USER%/private/full/%DOCID%"), //$NON-NLS-1$
		/** LIST: <br/> list of documents */
		LIST("https://docs.google.com/feeds/%USER%/private/full"), //$NON-NLS-1$
		/** METADATA: <br/> account information */
		METADATA("https://docs.google.com/feeds/metadata/%USER%"); //$NON-NLS-1$
		private final String uri;
		private Type(String uri) { this.uri = uri; }
		public String getUri() { return uri; }
	}
	
	// instance variables
	private String customUri = null;
	private String userId = "default"; //$NON-NLS-1$
	private String docId = null;
	private MapString additional = null;
	private Type type = null;
	
	/** setUri: <br/> Sets custom URI (use %USER% and %DOCID% as placeholders) */
	public void setUri(String uri) { this.customUri = uri; }
	/** setUserId: <br/> Sets User ID ('default' for current authorized user) */
	public void setUserId(String userId) { this.userId = userId; }
	/** setDocId: <br/> Sets Doc ID (may contain additional URL path segments separated by slash) */
	public void setDocId(String docId) { this.docId = docId; }
	/** setAdditional: <br/> Sets additional parameters (key-value-pairs) */
	public void setAdditional(MapString additional) { this.additional = additional; }
	/** setType: <br/> Sets Query Type */
	public void setType(Type type) { this.type = type; }
	
	/** getCustomUri: <br/> Gets Custom URI */
	public String getUri() { return this.customUri; }
	/** getUserId: <br/> Gets User ID */
	public String getUserId() { return this.userId; }
	/** getDocId: <br/> Gets Doc ID */
	public String getDocId() { return this.docId; }
	/** getQ: <br/> Gets additional parameters (key-value-pairs) */
	public MapString getAdditional() { return this.additional; }
	/** getType: <br/> Gets Query Type */
	public Type getType() { return this.type; }

	// constructor
	public DocumentsListQuery() {}

}